﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
using DIST.LR.ZHJG.Events;
using HSE.Events;

namespace HSE.Common
{
    [System.ComponentModel.DesignTimeVisible(false)]
    public partial class HorizontalNavi : UserControl
    {
        private string _ownerFlag;
        public HorizontalNavi()
        {
            InitializeComponent();
        }

        public void Binding(string ownerFlag,ObservableCollection<ToolBarNaviInfo> models)
        {
            _ownerFlag = ownerFlag;
            this.lst.ItemsSource = models;
        }

        private void RadRadioButton_Checked(object sender, RoutedEventArgs e)
        {
            Telerik.Windows.Controls.RadRadioButton btn = sender as Telerik.Windows.Controls.RadRadioButton;
            ToolBarNaviInfo t = btn.DataContext as ToolBarNaviInfo;
            //viewmodel.ModuleName;
            EventAggregatorRepository.EventAggregator
               .GetEvent<NaviClickEvent>()
               .Publish(new NaviClickInfo(){ Owner = _ownerFlag, NaviInfo =  t });
        }
    }
}
